package com.iloomo.util;

import java.util.List;
import java.util.Map;

/**
 * @author
 * @version 1.0
 * @className ReadJurisdiction
 * @date 2019/5/8 13:06
 * @description TODO
 */
public class ReadJurisdiction {
    /**根据权限获取本权限的列表(递归处理)
     * @param menuList：传入的总菜单
     * @param roleRights：加密的权限字符串
     * @return
     */
    public static List<Map> readJurisdiction(List<Map> mapList, String roleRights){
        for(int i=0;i<mapList.size();i++){
            if(!RightsHelper.testRights(roleRights, mapList.get(i).get("id").toString())){//判断是否有此菜单权限
                //menuList.get(i).put("hasMenu",RightsHelper.testRights(roleRights, menuList.get(i).get("id").toString()));
                //if(menuList.get(i).get("hasMenu").toString().equals("false")) {        //判断是否有此菜单权限
                mapList.remove(i);
                i--;
            }
        }
        return mapList;
    }
}
